'use strict';

const Controller = require('egg').Controller;

class HomeController extends Controller {
    async index() {
        const res = await this.service.utilsFilesCos.sts();
        console.log(res);
        this.ctx.body = res;
        // this.ctx.returnBody(200, '临时密钥获取成功', res);
        //     const { ctx, app, config } = this;
        //     const {
        //         testParam
        //     } = ctx.query;

        //     const rule = {
        //         testParam: [
        //             { required: true, message: 'testParam必填' }
        //         ]
        //     };

        //     if (!await ctx.validate(rule, { testParam })) return;

    //     const result = await app.mysql.select(config.userTable.info, {
    //         limit: 10,
    //         offset: 0
    //     });
    //     const testParam_jwt = await app.encodeToken({ testParam });
    //     ctx.returnBody(200, 'hi, egg', {
    //         testParam_md5: app.md5(testParam),
    //         testParam_jwt,
    //         result
    //     });
    }
}

module.exports = HomeController;
